<div bsModal #createOrEditModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="createOrEditModal"
    aria-hidden="true" [config]="{backdrop: 'static'}">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form *ngIf="active" #editForm="ngForm" novalidate (ngSubmit)="save()">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="!model.id">创建新的型号</span>
                        <span *ngIf="model.id">更改型号：{{model.code}}</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label>型号
                            <span class="required">*</span>
                        </label>
                        <input class="form-control" type="text"  [disabled] = "model.id" name="modelCode" [(ngModel)]="model.code" required>
                    </div>
                    <div class="form-group">
                        <label>名称
                            <span class="required">*</span>
                        </label>
                        <input class="form-control" type="text" name="modelName" [(ngModel)]="model.name" required>
                    </div>
                    <div class="form-group">
                        <label>描述信息</label>
                        <textarea class="form-control" name="modelDescription" cols="30" rows="3" [(ngModel)]="model.description"></textarea>
                    </div>

                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">{{l("Cancel")}}</button>
                    <button type="submit" class="btn btn-primary blue" [disabled]="!editForm.form.valid" [buttonBusy]="saving" [busyText]="'保存中...'">
                        <i class="fa fa-save"></i>
                        <span>{{l("Save")}}</span>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>